---------------------------------------------------------------------------------------------------------
       log:  F:\data\coxreplication.log
  log type:  text
 opened on:   8 Jun 2006, 14:40:38

. #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      coxreplication.do                               *;
. *       Date:           1/23/05                                        *;
. *       Author:         MRG                                             *;
. *       Purpose:        Replicate Amorim Neto and Cox 1997 for CPS      *;
. *       Input File:     coxappend.dta                                   *;
. *       Output File:    coxreplication.log                              *;
. *       Data Output:    coxappend.dta                                   *;
. *       Previous file:                                                  *;
. *       Machine:                                                        *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;

Current memory allocation

                    current                                 memory usage
    settable          value     description                 (1M = 1024k)
    --------------------------------------------------------------------
    set maxvar         5000     max. variables allowed           1.733M
    set memory           10M    max. data space                 10.000M
    set matsize         400     max. RHS vars in models          1.254M
                                                            -----------
                                                                12.987M

. use "C:\Documents and Settings\Matt Golder\My Documents\fsu\publications\cps2\coxappend.dta", clear;

. *use h:\cps\coxappend.dta;
. *     ****************************************************************  *;
. *           Summary Statistics                                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
       var12 |         0
        drop |        54    .0555556    .2312123          0          1
        year |        54    1985.167    1.969101       1981       1990
        enpv |        54    3.530846    1.728027     1.8444    10.3233
        enps |        54     2.93345     1.43717     1.1796       8.69
-------------+--------------------------------------------------------
       eneth |        54    1.572086    .6820787       1.01     3.7736
          ml |        54    12.32407    25.62891          1        150
       upper |        54    .0410163     .104919          0     .49799
      enpres |        54    1.146883    1.707402          0      5.689
    proximit |        54    .2861111    .4214683          0          1
-------------+--------------------------------------------------------
        lnml |        54    1.530797     1.37122          0   5.010635
    lmleneth |        54    2.324924     2.37556          0    10.8008
        smdp |        54    .3703704    .4874383          0          1
     smdpeth |        54    .6470183    .9896785          0     3.5562
       multi |        54    .5185185    .5043487          0          1
-------------+--------------------------------------------------------
     enpvlml |        54    6.221569    6.778793          0   32.92359
     enpvUpp |        54    .2287147    .7268405          0      3.916
      multiV |        54    .5185185    .5043487          0          1
       enpvQ |        54    1.537037    1.127913          0          3
    enpvmult |        54    2.308235     2.63141          0    10.3233
-------------+--------------------------------------------------------
    enpvsmdp |        54    .9894981    1.376881          0       4.13
    proxpres |        54    .9413589    1.484606          0      5.178
       drop2 |        54    .0925926    .2925824          0          1

. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                       Presidential Candidates                         *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *         Can't replicate Cox's results on enpres since he does not     *;
. *       include his data on electoral runoffs in his dataset.           *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                  Legislative Parties - Table 1 of article             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. replace upper=upper*100;
(10 real changes made)

. *     ****************************************************************  *;
. *                       Generate interaction terms                      *;
. *     ****************************************************************  *;
. generate enpv_upper = enpv*upper;

. generate eneth_upper=eneth*upper;

. *     ****************************************************************  *;
. *                           Cox's Specification                         *;
. *     ****************************************************************  *;
. regress enps enpv enpvlml enpv_upper;

      Source |       SS       df       MS              Number of obs =      54
-------------+------------------------------           F(  3,    50) =  208.05
       Model |  101.350194     3  33.7833981           Prob > F      =  0.0000
    Residual |   8.1190912    50  .162381824           R-squared     =  0.9258
-------------+------------------------------           Adj R-squared =  0.9214
       Total |  109.469285    53  2.06545822           Root MSE      =  .40297

------------------------------------------------------------------------------
        enps |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        enpv |    .507018   .0480599    10.55   0.000     .4104868    .6035492
     enpvlml |    .079701   .0117617     6.78   0.000     .0560769    .1033251
  enpv_upper |   .0037242   .0011053     3.37   0.001     .0015041    .0059443
       _cons |   .5819348   .1348059     4.32   0.000     .3111692    .8527004
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *                            Correct Specification                      *;
. *     ****************************************************************  *;
. regress enps enpv lnml enpvlml upper enpv_upper;

      Source |       SS       df       MS              Number of obs =      54
-------------+------------------------------           F(  5,    48) =  145.47
       Model |  102.692152     5  20.5384303           Prob > F      =  0.0000
    Residual |  6.77713382    48  .141190288           R-squared     =  0.9381
-------------+------------------------------           Adj R-squared =  0.9316
       Total |  109.469285    53  2.06545822           Root MSE      =  .37575

------------------------------------------------------------------------------
        enps |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        enpv |   .3847596   .0620076     6.21   0.000      .260085    .5094341
        lnml |  -.3084815   .1022189    -3.02   0.004    -.5140064   -.1029566
     enpvlml |   .1566183   .0277265     5.65   0.000     .1008703    .2123662
       upper |   .0124801   .0116578     1.07   0.290    -.0109596    .0359197
  enpv_upper |   .0015673   .0023782     0.66   0.513    -.0032144    .0063491
       _cons |   .9940022   .1952858     5.09   0.000     .6013538    1.386651
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *       Note that the coefficient on the interaction term using upper   *;
. *       is no longer significant.                                       *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                   Electoral Parties - Table 2 of article              *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                 Cox's Preferred Specification - Model 5               *;
. *     ****************************************************************  *;
. regress enpv upper  proximit proxpres lmleneth if drop==0;

      Source |       SS       df       MS              Number of obs =      51
-------------+------------------------------           F(  4,    46) =   28.32
       Model |   111.74453     4  27.9361324           Prob > F      =  0.0000
    Residual |  45.3794379    46   .98650952           R-squared     =  0.7112
-------------+------------------------------           Adj R-squared =  0.6861
       Total |  157.123968    50  3.14247935           Root MSE      =  .99323

------------------------------------------------------------------------------
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       upper |   .0351245   .0136981     2.56   0.014     .0075516    .0626974
    proximit |  -6.045146   .8753262    -6.91   0.000    -7.807086   -4.283205
    proxpres |   2.092345   .2568372     8.15   0.000     1.575358    2.609331
    lmleneth |     .39248   .0684018     5.74   0.000     .2547943    .5301657
       _cons |   2.401335   .2120035    11.33   0.000     1.974594    2.828076
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *                I was able to replicate his results exactly.           *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                               Add Enpres                              *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                       Add interaction term with upper                 *;
. *     ****************************************************************  *;
. generate uppereneth=upper*eneth;

. regress enpv lnml upper enpres  proximit proxpres eneth lmleneth uppereneth if drop==0;

      Source |       SS       df       MS              Number of obs =      51
-------------+------------------------------           F(  8,    42) =   17.38
       Model |  120.680116     8  15.0850144           Prob > F      =  0.0000
    Residual |   36.443852    42  .867710763           R-squared     =  0.7681
-------------+------------------------------           Adj R-squared =  0.7239
       Total |  157.123968    50  3.14247935           Root MSE      =  .93151

------------------------------------------------------------------------------
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        lnml |  -.0767434   .2960642    -0.26   0.797    -.6742252    .5207384
       upper |  -.0699356    .037632    -1.86   0.070      -.14588    .0060088
      enpres |   .2212485   .2730164     0.81   0.422     -.329721     .772218
    proximit |  -5.881298   .8350139    -7.04   0.000    -7.566424   -4.196171
    proxpres |   1.836853   .4306762     4.27   0.000      .967713    2.705993
       eneth |  -.0520821   .2838837    -0.18   0.855    -.6249827    .5208185
    lmleneth |   .3733582   .1993874     1.87   0.068    -.0290218    .7757382
  uppereneth |    .071425   .0242131     2.95   0.005      .022561     .120289
       _cons |   2.598446   .5131606     5.06   0.000     1.562846    3.634046
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *       Now let's look at robustness of interaction terms for upper     *;
. *       because I don't believe it.  Let's drop Belgium                 *;
. *     ****************************************************************  *;
. regress enpv lnml upper enpres  proximit  proxpres eneth lmleneth uppereneth if drop==0 & _n~=6;

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  8,    41) =   14.01
       Model |  99.1316679     8  12.3914585           Prob > F      =  0.0000
    Residual |  36.2758825    41  .884777622           R-squared     =  0.7321
-------------+------------------------------           Adj R-squared =  0.6798
       Total |   135.40755    49   2.7634194           Root MSE      =  .94063

------------------------------------------------------------------------------
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        lnml |   -.093987   .3015698    -0.31   0.757    -.7030195    .5150455
       upper |  -.0151655   .1313211    -0.12   0.909    -.2803739    .2500429
      enpres |   .2106608   .2767572     0.76   0.451    -.3482617    .7695833
    proximit |  -5.785052     .87164    -6.64   0.000    -7.545365   -4.024739
    proxpres |   1.821745   .4362711     4.18   0.000      .940678    2.702813
       eneth |  -.0515978   .2866641    -0.18   0.858    -.6305278    .5273322
    lmleneth |   .3872216   .2038373     1.90   0.065    -.0244361    .7988793
  uppereneth |   .0219175   .1162257     0.19   0.851     -.212805      .25664
       _cons |   2.594835    .518249     5.01   0.000      1.54821     3.64146
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *       Interaction term for upper is nowhere near significance now.    *;
. *       The result is purely due to Belgium which is a huge outlier as  *;
. *       the figures below indicate.  This result does not stand up.     *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *           Redo Cox's original specification without Belgium           *;
. *     ****************************************************************  *;
. regress enpv lnml upper  proximit  proxpres eneth lmleneth if drop==0 & _n~=6;

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  6,    43) =   19.20
       Model |  98.6077192     6  16.4346199           Prob > F      =  0.0000
    Residual |  36.7998313    43  .855810029           R-squared     =  0.7282
-------------+------------------------------           Adj R-squared =  0.6903
       Total |   135.40755    49   2.7634194           Root MSE      =   .9251

------------------------------------------------------------------------------
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        lnml |  -.0756765   .2898538    -0.26   0.795    -.6602223    .5088694
       upper |    .010258   .0153306     0.67   0.507     -.020659    .0411751
    proximit |  -5.858465   .8176651    -7.16   0.000    -7.507444   -4.209486
    proxpres |   2.082287   .2429965     8.57   0.000     1.592238    2.572336
       eneth |  -.0681893    .280856    -0.24   0.809    -.6345893    .4982108
    lmleneth |   .3894865   .1958031     1.99   0.053     -.005388     .784361
       _cons |   2.612305   .5085373     5.14   0.000     1.586742    3.637868
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *               Again the results on uppertier disappear.               *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                            Outlier Analyses                           *;
. *     ****************************************************************  *;
. regress enpv lnml upper enpres  proximit  proxpres eneth lmleneth uppereneth if drop==0;

      Source |       SS       df       MS              Number of obs =      51
-------------+------------------------------           F(  8,    42) =   17.38
       Model |  120.680116     8  15.0850144           Prob > F      =  0.0000
    Residual |   36.443852    42  .867710763           R-squared     =  0.7681
-------------+------------------------------           Adj R-squared =  0.7239
       Total |  157.123968    50  3.14247935           Root MSE      =  .93151

------------------------------------------------------------------------------
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        lnml |  -.0767434   .2960642    -0.26   0.797    -.6742252    .5207384
       upper |  -.0699356    .037632    -1.86   0.070      -.14588    .0060088
      enpres |   .2212485   .2730164     0.81   0.422     -.329721     .772218
    proximit |  -5.881298   .8350139    -7.04   0.000    -7.566424   -4.196171
    proxpres |   1.836853   .4306762     4.27   0.000      .967713    2.705993
       eneth |  -.0520821   .2838837    -0.18   0.855    -.6249827    .5208185
    lmleneth |   .3733582   .1993874     1.87   0.068    -.0290218    .7757382
  uppereneth |    .071425   .0242131     2.95   0.005      .022561     .120289
       _cons |   2.598446   .5131606     5.06   0.000     1.562846    3.634046
------------------------------------------------------------------------------

. predict l, leverage;

. graph7 l if e(sample), box symbol([var12]);

. *translate @Graph h:\Dissertation\parties\cps\nine.wmf;
. predict d, cooksd;

. graph7 d if e(sample), box symbol([var12]);

. *translate @Graph h:\Dissertation\parties\cps\ten.wmf;
. save    coxreplication, replace;
file coxreplication.dta saved

.  exit;

end of do-file

. log close
       log:  F:\data\coxreplication.log
  log type:  text
 closed on:   8 Jun 2006, 14:40:47
---------------------------------------------------------------------------------------------------------
